def jieChange(n):
  if n==0:
    return 1
  else:
    return n*jieChange(n-1)
def oddNum():
  sum = 0
  mid =0
  for i in range(1,9):
    if(i==1):
      mid =4
    else:
      mid = 4*6*jieChange(6)/jieChange(8-i)
    print(f"{i}位数的奇数个数是{mid}")
    sum+=mid
  return sum
print(oddNum())

# 人工智能优化后
from math import factorial
def count_odd_numbers():
    total_count = 4  # 1位数的情况
    print("1位数的奇数个数是4")
    
    for length in range(2, 9):
        # 计算排列数
        if length == 2:
            mid = 6 * 4
        else:
            mid = 6 * 4 * (factorial(6) // factorial(6 - (length - 2))) # // 表示整除
        print(f"{length}位数的奇数个数是{mid}")
        total_count += mid
    
    return total_count

# 测试函数并打印结果
result = count_odd_numbers()
print(f"由数字0-7组成的不重复奇数个数总和是: {result}")